home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / develop / libsrc11.arc / RDBLKSCI.C < prev    next >
C/C++ Source or Header  |  1989-04-27  |  1KB  |  37 lines

  1. /*    rdblksci.c 4.2        */
  2. /*F****************************************************************************
  3.  
  4. FUNCTION NAME:    rdblksci
  5.  
  6. ACTION:        Read count characters from the SCI serial hardware.
  7.  
  8. PARAMETERS:
  9.         array:    address of an array of bytes to be written to.
  10.         count:    number of bytes to read from port C.
  11.  
  12. RETURNS:    (void)
  13.  
  14. ******************************************************************************/
  15.  
  16. #include <hc11/directives.h>
  17.  
  18. SMALL
  19. void rdblksci(array, count)
  20.  
  21.     unsigned short    *array;        /* pointer to data to be read */
  22.     int        count;        /* number of bytes to be read */
  23.  
  24.     {
  25.  
  26.     /****************************************************************/
  27.     /*    Note that "while ((count--) > 0)" is equivalent to    */
  28.     /*    "while ((--count) >= 0)" but the pre-decrement        */
  29.     /*    version is more efficient than the post-decrement    */
  30.     /*    version.                        */
  31.     /****************************************************************/
  32.  
  33.     while ((--count) >= 0)
  34.         *(array++) = rdbytsci();
  35.  
  36.     }    /* end of rdblksci    */
  37.